include(cc_library)
include(cc_test)

include_directories(
  ${CMAKE_SOURCE_DIR}/third_party/spdlog/include
)


cc_library(
  NAME
    npu_kernels_impl
  HDRS
    npu_split_impl.h
    npu_linear_impl.h
    npu_rms_norm_impl.h
    npu_rope_impl.h
  SRCS
    npu_split_impl.cpp
    npu_linear_impl.cpp
    npu_rms_norm_impl.cpp
    npu_rope_impl.cpp
  DEPS
    :npu_layers 
    :model_context
    :state_dict
    glog::glog
    torch
    torch_npu
)

cc_test(
  NAME
    npu_rms_norm_test
  SRCS
    npu_rms_norm_test.cpp
  DEPS
    :npu_kernels_impl
    GTest::gtest
    GTest::gtest_main
    xllm_kernels
    c_sec
    atb
    spdlog::spdlog
)

cc_test(
  NAME
    npu_linear_test
  SRCS
    npu_linear_test.cpp
  DEPS
    :npu_kernels_impl
    GTest::gtest
    GTest::gtest_main
    xllm_kernels
    c_sec
    atb
    spdlog::spdlog
)

cc_test(
  NAME
    npu_split_test
  SRCS
    npu_split_test.cpp
  DEPS
    :npu_kernels_impl
    GTest::gtest
    GTest::gtest_main
    xllm_kernels
    c_sec
    atb
    spdlog::spdlog
)

cc_test(
  NAME
    npu_rope_impl_test
  SRCS
    npu_rope_impl_test.cpp
  DEPS
    :npu_kernels_impl
    GTest::gtest
    GTest::gtest_main
    xllm_kernels
    c_sec
    atb
    spdlog::spdlog
)

cc_test(
  NAME
    npu_sample_model_test
  SRCS
    npu_sample_model_test.cpp
  DEPS
    :npu_kernels_impl
    GTest::gtest
    GTest::gtest_main
    xllm_kernels
    c_sec
    atb
    spdlog::spdlog
)